﻿@{
    RoadFlow.Business.HomeSet homeSet = new RoadFlow.Business.HomeSet();
    var ItemsList = homeSet.GetListByUserId(Current.UserId);
}
<form id="form1">
    <div class="homemessage" style="margin-top:15px;">
        <table cellpadding="0" cellspacing="0" border="0">
            <tr>
                <td>
                    @foreach (var item in ItemsList.FindAll(p => p.Type == 0))
                    {
                        string bgcolor = item.BackgroundColor.IsNullOrWhiteSpace() ? "#0081FF" : item.BackgroundColor;
                        string ico = item.Ico.IsNullOrEmpty() ? "fa-coffee" : item.Ico;
                        string fontcolor = item.FontColor.IsNullOrWhiteSpace() ? "#ffffff" : item.FontColor;
                        string count = homeSet.GetDataSourceString(item);
                        <a class="homemsglink" @Html.Raw(item.LinkURL.IsNullOrWhiteSpace() ? "" : "href=\"javascript:void(0);\" onclick=\"top.openApp('" + RoadFlow.Business.Wildcard.Filter(item.LinkURL) + "',0,'" + item.Title + "','');\"")>
                            <div class="homemessagediv" style="background:@bgcolor;">
                                <div>
                                    <div class="homemessagenumber">
                                        @if (ico.IsFontIco())
                                        {
                                            <div class="fa @ico" style="font-size:38px;margin-left:20px;float:left; padding-top:12px;"></div><div style="float:right; padding-top:10px; vertical-align:middle;">@count</div>
                                        }
                                        else
                                        {
                                            <div style="margin-left:15px;float:left; padding-top:12px;"><img src="@ico" border="0" style="vertical-align:middle;" /></div><div style="float:right; padding-top:10px; vertical-align:middle;">@count</div>
                                        }
                                    </div>
                                </div>
                                <div class="homemessagetext">
                                    <div class="homemessagetextbg"></div>
                                    <div class="homemessagetextword" style="color:@fontcolor;">@item.Title</div>
                                </div>
                            </div>
                        </a>
                    }
                </td>
            </tr>
        </table>
    </div>
    <div style="width:96%; margin:18px auto 0 auto;">
        <table cellpadding="0" cellspacing="0" border="0" style="width:100%;">
            <tr>
                <td style="width:65%; vertical-align:top;">
                    @foreach (var item in ItemsList.FindAll(p => p.Type == 1))
                    {
                        <div class="homelistdiv">
                            <div style="height:35px; font-size:14px;">
                                @if (!item.Ico.IsNullOrWhiteSpace())
                                {
                                    if (item.Ico.IsFontIco())
                                    {
                                        <div class='fa @item.Ico' style='font-size:18px;float:left;margin-right:6px;padding-top:12px;'></div>
                                        <div style="padding-top:10px; float:left; font-weight:bold;">@item.Title</div>
                                    }
                                    else
                                    {
                                        <div style="padding-top:10px; float:left; font-weight:bold;background:url(@item.Ico) no-repeat left 12px; padding-left:20px;">@item.Title</div>
                                    }
                                }
                                @if (!item.LinkURL.IsNullOrWhiteSpace())
                                {
                                    <div style="padding-top:10px; float:right; margin-right:10px;">
                                        <a href="javascript:void(0);" onclick="top.openApp('@(RoadFlow.Business.Wildcard.Filter(item.LinkURL))',0,'@item.Title','l_@item.Id.ToString("N")');">
                                            <i class="fa fa-angle-double-right"></i><span style="font-size:12px; margin-left:3px;">更多...</span>
                                        </a>
                                    </div>
                                }
                            </div>
                            <div>
                                @Html.Raw(homeSet.GetDataSourceString(item))
                            </div>
                        </div>
                    }
                </td>
                <td style="vertical-align:top; padding:0 0 0 30px;">
                    @foreach (var item in ItemsList.FindAll(p => p.Type == 2))
                    {
                        <div class="homelistdiv">
                            <div style="height:35px; font-size:14px;">
                                @if (!item.Ico.IsNullOrWhiteSpace())
                                {
                                    if (item.Ico.IsFontIco())
                                    {
                                        <div class='fa @item.Ico' style='font-size:18px;float:left;margin-right:6px;padding-top:12px;'></div>
                                        <div style="padding-top:10px; float:left; font-weight:bold;">@item.Title</div>
                                    }
                                    else
                                    {
                                        <div style="padding-top:10px; float:left; font-weight:bold;background:url(@item.Ico) no-repeat left 12px; padding-left:20px;">@item.Title</div>
                                    }
                                }

                                @if (!item.LinkURL.IsNullOrWhiteSpace())
                                {

                                    <div style="padding-top:10px; float:right; margin-right:10px;">
                                        <a href="javascript:void(0);" onclick="top.openApp('@(RoadFlow.Business.Wildcard.Filter(item.LinkURL))',0,'@item.Title','l_@item.Id.ToString("N")');">
                                            <i class="fa fa-angle-double-right"></i><span style="font-size:12px; margin-left:3px;">更多...</span>
                                        </a>
                                    </div>
                                }
                            </div>
                            @Html.Raw(homeSet.GetDataSourceString(item))
                        </div>
                    }
                </td>
            </tr>
        </table>
    </div>
</form>